import React, { Component } from 'react';
import { connect } from 'dva';

class Home extends Component {
    componentDidMount() {
        const { dispatch } = this.props;
        dispatch({ type: 'home/getHomeInfo' });
    }
    render() {
        const { homeInfo } = this.props.home;

        return <div>
            {homeInfo.map((item, index) => {
                return <div key={item.key}>
                    {item.name}
                </div>
            })}
        </div>
    }
}

export default connect(({ home }) => ({ home }))(Home);
